//
//  Player_Model.h
//  ICE_Player
//
//  Created by lijinxin on 11-11-4.
//  Copyright (c) 2011年 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "EkkVideoView.h"

#define DEFAULT_THUMBNAIL_TIME (60)

typedef enum {
    E_SCM_WIDTH_ADJUSTED = 0,
    E_SCM_HEIGHT_ADJUSTED,
    E_SCM_RAW,
    E_SCM_COUNT,
}E_SCREEN_MODE;

typedef enum {
    E_PCB_NONE = 0,
    E_PCB_LOADED,
    E_PCB_END,
    E_PCB_START_PLAY,
    E_PCB_PAUSED,
    E_PCB_ERROR,
    E_PCB_CLOSED,
    E_PCB_COUNT,
}E_PLAYER_CALLBACK;

typedef enum {
    E_PS_NONE = 0,
    E_PS_READY,
    E_PS_LOADING,
    E_PS_PAUSED,
    E_PS_PLAYING,
    E_PS_CLOSING,
    E_PS_END,
    E_PS_COUNT,
}E_PLAYER_STATE;

typedef struct tagPLAYER_INFO
{
    long width;
    long height;
    long cur_play_sec;
    long file_len_sec;
    float volume;
    E_SCREEN_MODE screen_mode;
}PLAYER_INFO;

typedef struct tagMOVIE_INFO
{
    long width;
    long height;
    long duration_in_seconds;
    NSString* movie_path;
    NSString* thumbnail_path;
}MOVIE_INFO;

@interface Player_Model : NSObject
{
}

+ (BOOL)Init;

+ (void)Un_Init;

+ (BOOL)Load:(char*)url;

+ (void)Get_Info:(PLAYER_INFO*)info;

+ (BOOL)Close;

+ (void)Pause;

+ (void)Play;

+ (long)Seek:(long)second;

+ (void)setRenderView:(UIView*)view;

+ (float)set_Volume:(float)percents;

+ (float)get_Volume;

+ (void)set_Screen_Mode:(E_SCREEN_MODE)mode;

+ (void)change_Screen_Mode;

+ (E_PLAYER_STATE)get_State;

+ (void)set_CallBack:(E_PLAYER_CALLBACK)type target:(id)object callback:(SEL)func withObject:(id)parameter;

+ (void)get_Movie_Info:(NSString*)file_path thumbnail_path:(NSString*)thumbnail_path thumbnail_width:(NSInteger)width thumbnail_height:(NSInteger)height thumbnail_time_at:(NSInteger)seconds target:(id)object got_info_callback:(SEL)func withObject:(id)parameter;

+ (MOVIE_INFO)current_Movie_Info;

+ (void)config_Subtitle:(CGRect*)prect fontEffect:(enum FontEffectType)font_effect  fontSize:(unsigned long)font_size fontColor:(unsigned long)font_color;

+ (void)hide_Subtitle:(BOOL)hidden;

+ (BOOL)is_Subtitle_Hidden;

+ (void)On_Go_To_Back_Ground;

+ (void)On_Resume_From_Back_Ground;

+ (void)On_Will_Resign_Active;

+ (void)On_Did_Become_Active;

@end
